package guda.house.biz.form.village;

import guda.house.dal.dataobject.OwnerDO;

import javax.validation.constraints.NotNull;

/**
 * Created by well on 15/11/14.
 */
public class OwnerEditForm extends OwnerForm{

    @NotNull(message = "不能为空")
    private Long ownerId;

    public void initForm(OwnerDO ownerDO){
        setOwnerId(ownerDO.getOwnerId());
        setPhone(ownerDO.getPhone());
        setOwnerStatus(ownerDO.getOwnerStatus());
        setWeixin(ownerDO.getWeixin());
        setOwnerName(ownerDO.getOwnerName());
        setCertNo(ownerDO.getCertNo());
        setEmail(ownerDO.getEmail());
        setIsEmployee(ownerDO.getIsEmployee());
        setQq(ownerDO.getQq());
    }

    public OwnerDO toDO(){
        OwnerDO ownerDO = super.toDO();
        ownerDO.setOwnerId(ownerId);
        return ownerDO;
    }

    public Long getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(Long ownerId) {
        this.ownerId = ownerId;
    }
}
